<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head th:include="common/common_css::common_css('云采购')">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body class="skin-blue">
	<!-- header logo: style can be found in header.less -->
	<div th:replace="header::header"></div>
	<div class="wrapper row-offcanvas row-offcanvas-left">
		<!-- Left side column. contains the logo and sidebar -->
		<div th:replace="leftMenu::leftMenu"></div>

		<!-- Right side column. Contains the navbar and content of the page -->
		<aside class="right-side">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>
					用户管理 <small>权限信息</small>
				</h1>
				<ol class="breadcrumb">
					<li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
					<li><a href="#">用户管理</a></li>
					<li class="active">权限信息</li>
				</ol>
			</section>	

			<!-- Main content -->
			<section class="content">
				<div class="row">
					<div class="box">
						<!-- <div class="box-header">
							<h3 class="box-title">Bordered Table</h3>
						</div> -->
						<!-- /.box-header -->
						<div class="box-body">
							<table class="table table-bordered">
								<tr>
									<th style="width: 80px">序号</th>
									<th>权限名称</th>
									<th>权限描述</th>
									<th style="width: 120px">是否启用</th>
									<th style="width: 120px">是否超级用户</th>
									<th>操作</th>
								</tr>
								<tr th:each="authority,iterStat : ${authorities}"> 
									<th th:text="${iterStat.index}"></th>   
					                <td th:text="${authority.authority_name}"></td>  
					                <td th:text="${authority.authority_desc}"></td>  
					                <td>
					                	<span th:if="${authority.enabled} eq '1'"><button class="btn btn-success btn-sm">是</button></span>
					                	<span th:if="${authority.enabled} ne '1'"><button class="btn btn-danger btn-sm">否</button></span>
					                </td>
					                <td>
					                	<span th:if="${authority.issys} eq '1'"><button class="btn btn-success btn-sm">是</button></span>
					                	<span th:if="${authority.issys} ne '1'"><button class="btn btn-danger btn-sm">否</button></span>
					                </td>
					                <td>
					                	<button class="btn btn-success btn-sm edit_authority"  th:value="${authority.authority_id}">修改</button>
					                	<button class="btn btn-danger btn-sm delete_authority" th:value="${authority.authority_id}">删除</button>
					                	<button class="btn btn-warning btn-sm menu_selected" th:value="${authority.authority_id}">菜单配置</button>
					                </td>
					              </tr>
							</table>
						</div>
						<!-- /.box-body -->
						<div class="box-footer clearfix">
							<ul class="pagination pagination-sm no-margin pull-left">
								<button class="btn btn-danger" id="addDialogBtn">新增</button>
							</ul>
						</div>
					</div>
					<!-- /.box -->
				</div>
				<!-- /.row -->
			</section>
			<!-- /.content -->
		</aside>
		<!-- /.right-side -->
	</div>
	<!-- ./wrapper -->
	
	<!-- 添加资源信息  -->
	<div class="modal fade" id="addResourceDialog" tabindex="-1" role="dialog" 
		aria-labelledby="addDialog" aria-hidden="true">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	                <h4 class="modal-title" id="myModalLabel">菜单配置</h4>
	            </div>
	            <div class="modal-body">
	           		<table class="table table-bordered" id="menu_table"></table>
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	                <button type="button" id="editMenu" class="btn btn-primary">提交</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	
	<!-- 添加角色信息  -->
	<div class="modal fade" id="addDialog" tabindex="-1" role="dialog" 
		aria-labelledby="addDialog" aria-hidden="true">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	                <h4 class="modal-title" id="myModalLabel">权限配置</h4>
	            </div>
	            <div class="modal-body">
	 				<form role="form">
                    	<div class="box-body">
                    		<div class="form-group">
                            	<label for="authorityId">权限ID</label>
                               	<input type="text" class="form-control" id="authorityId" placeholder="请输入权限ID...">
                           	</div>
							<div class="form-group">
                            	<label for="authorityName">权限名称</label>
                               	<input type="text" class="form-control" id="authorityName" placeholder="请输入权限名称...">
                           	</div>
                           	<div class="form-group">
                            	<label for="authorityDesc">权限描述</label>
                               	<input type="text" class="form-control" id="authorityDesc" placeholder="请输入权限描述...">
                           	</div>
                   			<div class="form-group">
                      			<label><input id="enabled" name='enabled' type="checkbox"> 是否启用</label>
                   			</div>
                   			<div class="form-group">
                      			<label><input id="issys" name="issys" type="checkbox"> 是否超级用户</label>
                   			</div>
						</div><!-- /.box-body -->
					</form>           	
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	                <button type="button" id="addAuthorityBtn" class="btn btn-primary">提交</button>
	                <button type="button" id="editAuthorityBtn" class="btn btn-primary">提交</button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	
	<div th:replace="common/common_js::common_js"></div>
	<!-- user -->	
	<script th:src="@{js/crm/authority.js}" src="../static/js/crm/authority.js" type="text/javascript"></script>
</body>
</html>